package com.juku2024.juku.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import com.juku2024.juku.db.entity.VideoPlayHistoryEntity;


@Dao
public interface VideoPlayDao {

    @Query("SELECT * FROM VideoPlayHistoryTable WHERE videoId=:videoId")
    VideoPlayHistoryEntity query(long videoId);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(VideoPlayHistoryEntity entity);

    @Query("DELETE FROM VideoPlayHistoryTable WHERE videoId=:videoId")
    void delete(long videoId);

    @Query("DELETE FROM VideoPlayHistoryTable")
    void deleteAll();
}
